import { service } from "@/utils";

export const getMaterialsList = () => {
  return service({
    url: "/materials",
    method: "get",
  });
};

export const getMaterialsParent = () => {
  return service({
    url: `/materials/parent`,
    method: "get",
  });
};

export const findMaterialsKeywords = (name: string) => {
  return service({
    url: `/materials/${name}`,
    method: "get",
  });
};

export const createMaterials = (data: any) => {
  return service({
    url: "/materials",
    method: "post",
    data,
  });
};

export const updateMaterials = (id: number, data: any) => {
  return service({
    url: `/materials/${id}`,
    method: "patch",
    data,
  });
};
